<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      >
    <h:head>
        <title>Sistema Clínica Odontológica</title>
        <style type="text/css">
            *{
                font-size: 12px !important;
            }
        </style>
    </h:head>
    <h:body onload="painelLogin.show(); #{loginBean.validaUsuarioSessaoIndex}" >
        
        <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>  
        
        <p:dialog modal="true" widgetVar="statusDialog" header="Status"  
                  draggable="false" closable="false" >Processando...</p:dialog>
        
        <p:dialog id="painel" header="Login" widgetVar="painelLogin" closable="false" draggable="false" resizable="false">

            <h:form id="formLogin">

                <h:panelGrid columns="2">

                    <h:outputText value="Usuário: "/>
                    <p:inputText id="itUsuario" label="Usuário" required="true" value="#{loginBean.usuario}"/>

                    <h:outputText value="Senha: "/>
                    <p:password id="itSenha" label="Senha" required="true" value="#{loginBean.senha}"/>

                </h:panelGrid>

                <p:commandButton id="btSalvar" value="Entrar" update="formLogin" actionListener="#{loginBean.logar}"/>

                <p:messages id="mensagens"/>

            </h:form>            
        </p:dialog>
    </h:body>
</html>
